<div class="pub-body">
  <!-- <h1>公司管理</h1> -->
  <!-- 公司列表 -->
  <div class="project">
    <!-- <el-button icon="el-icon-plus" class="addBtn" type="primary" @click="dialogCompanyOpen">新增项目</el-button> -->
    <el-table :data="companyData" border style="width: 100%"
              :header-cell-style="{background:'#eef1f6',color:'#606266'}">
      <el-table-column prop="contractNo" label="项目ID"></el-table-column>
      <el-table-column prop="assetName" label="项目名称"></el-table-column>
      <el-table-column prop="assetType" label="总投资额"></el-table-column>
      <el-table-column prop="assetLevel" label="所有付款节点数"></el-table-column>
      <el-table-column prop="statistics" label="已付款节点数"></el-table-column>
      <el-table-column prop="startTime" label="计划开始时间"></el-table-column>
      <el-table-column prop="endTime" label="计划结束时间"></el-table-column>
      <!-- <el-table-column prop="construction" label="主要参建单位" ></el-table-column> -->
      <el-table-column fixed="right" label="操作" width="300">
        <template slot-scope="scope">
          <el-button @click="appendNode.status = true" type="primary"
                     icon="el-icon-edit-outline" size="small">新增合同
          </el-button>
          <el-button @click="lookTemplateOpen(scope.row)" type="primary"
                     icon="el-icon-tickets" size="small">查看合同
          </el-button>

          <!-- <el-button @click="updateTemplateOpen(scope.row)" type="warning" icon="el-icon-edit-outline" size="small">修改项目</el-button> -->
        </template>
      </el-table-column>
    </el-table>
  </div>

  <!-- 查看合同弹窗 -->
  <el-dialog width="1000px" title="查看合同"
             :visible.sync="looktemplate.status">
    <el-table :data="lookdata" border style="width: 100%"
              :header-cell-style="{background:'#eef1f6',color:'#606266'}">
      <el-table-column prop="contractNo" label="项目ID"></el-table-column>
      <el-table-column prop="assetName" label="项目名称"></el-table-column>
      <el-table-column prop="assetType" label="合同名称"></el-table-column>
      <el-table-column fixed="right" label="操作" width="300">
        <template slot-scope="scope">
          <el-button @click="lookTemplateOpen(scope.row)" type="primary"
                     icon="el-icon-tickets" size="small">查看附件
          </el-button>
          <!-- <el-button @click="updateTemplateOpen(scope.row)" type="warning" icon="el-icon-edit-outline" size="small">修改项目</el-button> -->
        </template>
      </el-table-column>
    </el-table>
  </el-dialog>

    <!-- 项目节点新增 -->
    <el-dialog :title="appendNode.title" width="40%"
               :visible.sync="appendNode.status">
      <el-form ref="appendNodeFrom" :rules="appendNodeRules"
               :model="appendNodeFrom" label-width="160px">
        <el-form-item prop="id" label="合同编号">
          <el-input style="width: 350px;" placeholder="请输入合同编号"
                    v-model="appendNodeFrom.id"></el-input>
        </el-form-item>
        <el-form-item prop="name" label="合同名称">
          <el-input style="width: 350px;" placeholder="请输入合同名称"
                    v-model="appendNodeFrom.name"></el-input>
        </el-form-item>
        <el-form-item prop="label" label="付款项">
          <el-input style="width: 350px;" placeholder="请输入付款项"
                    v-model="appendNodeFrom.label"></el-input>
        </el-form-item>
        <el-form-item prop="responsibleDepartment" label="责任部门">
          <el-select v-model="appendNodeFrom.responsibleDepartment"
                     placeholder="请选择责任部门" style="width: 350px;">
            <el-option v-for="item in departmentList" :label="item" :key="item"
                       value="item"></el-option>
            <!-- <el-option label="规土部" value="规土部"></el-option>
            <el-option label="财务部" value="财务部"></el-option>
            <el-option label="工程部" value="工程部"></el-option> -->
          </el-select>
          <!-- <el-input style="width: 350px;" placeholder="请输入责任部门" v-model="appendNodeFrom.responsibleDepartment"></el-input> -->
        </el-form-item>
        <el-form-item label="合同签订日期" prop="timeValue">
          <el-date-picker type="date" placeholder="签订日期"
                          v-model="companyFrom.timeValue"
                          style="width: 350px;"></el-date-picker>
        </el-form-item>
        <el-form-item prop="plannedHours" label="付款方">
          <el-input style="width: 350px;" placeholder="请输入付款方"
                    v-model="appendNodeFrom.plannedHours"></el-input>
        </el-form-item>
        <el-form-item prop="precondition" label="收款方">
          <el-input style="width: 350px;" placeholder="请输入收款方"
                    v-model="appendNodeFrom.precondition"></el-input>
        </el-form-item>
        <el-form-item prop="moneynum" label="交易金额">
          <el-input style="width: 350px;" placeholder="请输入交易金额"
                    v-model="appendNodeFrom.precondition"></el-input>
        </el-form-item>
        <el-form-item prop="desc" label="上传合同">
          <el-upload
            class="upload-demo"
            drag
            action="https://jsonplaceholder.typicode.com/posts/"
            multiple
            prop="uploadht">
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
          </el-upload>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="submitForm('appendNodeFrom')">提交
          </el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
  </el-dialog>

  <!-- 新增模板弹窗 -->
  <el-dialog width="1000px" :title="dialogCompany.title"
             :visible.sync="dialogCompany.status">
    <el-form ref="companyFrom" :rules="companyRules" :model="companyFrom"
             label-width="160px">
      <el-table-column prop="contractNo" label="项目ID"></el-table-column>
      <el-table-column prop="assetName" label="项目名称"></el-table-column>
      <el-table-column prop="assetType" label="项目类型"></el-table-column>
      <el-table-column prop="assetLevel" label="项目层级"></el-table-column>
      <el-table-column prop="statistics" label="是否列统"></el-table-column>
      <el-table-column prop="startTime" label="计划开始时间"></el-table-column>
      <el-table-column prop="endTime" label="计划结束时间"></el-table-column>
      <el-table-column prop="construction" label="主要参建单位"></el-table-column>
      <el-table-column prop="investment" label="总投资"></el-table-column>
      <el-table-column prop="legalUnit" label="项目法人单位"></el-table-column>
      <el-table-column prop="site" label="建设地点"></el-table-column>
      <el-row>
        <el-col :span="12">
          <el-form-item prop="assetName" label="项目名称">
            <el-input style="width: 300px;" placeholder="请输入模板名称"
                      v-model="companyFrom.companyName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="assetType" label="项目类型">
            <el-input style="width: 300px;" placeholder="请输入项目类型"
                      v-model="companyFrom.companyContact"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item prop="assetLevel" label="项目层级">
            <el-input style="width: 300px;" placeholder="请输入项目层级"
                      v-model="companyFrom.companyName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="statistics" label="是否列统">
            <el-input style="width: 300px;" placeholder="请输入项目是否列统"
                      v-model="companyFrom.companyContact"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="12">
          <el-form-item prop="startTime" label="计划开始时间">
            <el-date-picker type="date" placeholder="计划开始时间"
                            v-model="companyFrom.restrictedType"
                            style="width: 300px;"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="endTime" label="计划结束时间">
            <el-date-picker type="date" placeholder="计划结束时间"
                            v-model="companyFrom.restrictedType"
                            style="width: 300px;"></el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item prop="construction" label="主要参建单位">
            <el-input style="width: 300px;" placeholder="请输入主要参建单位"
                      v-model="companyFrom.companyName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="investment" label="总投资">
            <el-input style="width: 300px;" placeholder="请输入总投资"
                      v-model="companyFrom.companyContact"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item prop="legalUnit" label="项目法人单位">
            <el-input style="width: 300px;" placeholder="请输入项目法人单位"
                      v-model="companyFrom.companyName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="site" label="建设地点">
            <el-input style="width: 300px;" placeholder="请输入建设地点"
                      v-model="companyFrom.companyContact"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item>
        <el-button type="primary" @click="addCompany('companyFrom')"><span
          v-text="dialogCompany.title"></span></el-button>
        <el-button @click="resetCompany">重置</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>

  <!-- 修改模板弹窗 -->
  <el-dialog width="1000px" :title="updatetemplate.title"
             :visible.sync="updatetemplate.status">
    <el-form ref="companyFrom" :rules="companyRules" :model="companyFrom"
             label-width="160px">
      <el-row>
        <el-col :span="12">
          <el-form-item prop="companyName" label="模板名称">
            <el-input style="width: 300px;" placeholder="请输入模板名称"
                      v-model="companyFrom.companyName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="companyContact" label="创建人">
            <el-input style="width: 300px;" placeholder="请输入创建人"
                      v-model="companyFrom.companyContact"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item prop="companyTel" label="项目分类">
            <el-select style="width: 300px;" v-model="companyFrom.companyTel"
                       placeholder="请选择项目类型">
              <el-option label="楼宇" value="1"></el-option>
              <el-option label="市政" value="2"></el-option>
              <el-option label="其他" value="3"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item prop="requisitionLimit" label="专项名称">
            <el-select style="width: 300px;"
                       v-model="companyFrom.requisitionLimit"
                       placeholder="请选择专项">
              <el-option label="土地" value="1"></el-option>
              <el-option label="前期" value="2"></el-option>
              <el-option label="其他" value="3"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item prop="restrictedType" label="创建时间">
            <el-col class="dateCol" :span="12">
              <el-date-picker type="date" placeholder="创建时间"
                              v-model="companyFrom.restrictedType"
                              style="width: 100%;"></el-date-picker>
            </el-col>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item prop="restrictedType1" label="选择节点">
            <el-transfer v-model="companyFrom.restrictedType1"
                         @change="handleChange" :data="tempData"></el-transfer>
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item>
        <el-button type="primary" @click="addCompany('companyFrom')"><span
          v-text="dialogCompany.title"></span></el-button>
        <el-button @click="resetCompany">重置</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>

</div>
